<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			ul{
				list-style: none;
			}
			li{
				display: block;
				width: 70px;
				height: 50px;
				background-color: cornflowerblue;
				float: left;
				margin: 10px;
			}
			.box{
				width: 70px;
				height: 100px;
				background-color: antiquewhite;
				margin-top: 50px;
			}
		</style>
	</head>
	<body>
			
		<div id="app">
			<button @click="add">+</button>
			<span v-text="num"></span>
			<button @click="sub">-</button>
		</div>
		
		
	</body>
	<script type="text/javascript">
		var app = new Vue({
			el:'#app',
			data:{
				num:0,
			},
			methods:{
				add:function(){
					if(this.num<10){
						this.num++;
					}
				},
				sub:function(){
					if(this.num>0){
						this.num--;
					}
				}
			},
		})
	</script>
</html>
